
pub fn check_semantics(node: &Node) -> Result<(), String> {
    match node {
        Node::Number(_) => Ok(()),
        Node::BinaryOp { left, operator, right } => {
            check_semantics(left)?;
            if *operator == '/' {
                if let Node::Number(0) = **right {
                    return Err("Division by zero".to_string());
                }
            }
            Ok(())
        }
    }
}
